package com.shure.surdes.modules.common.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.shure.surdes.common.result.R;
import com.shure.surdes.common.result.Result;
import com.shure.surdes.modules.common.vo.LoginVo;

import java.util.UUID;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@RestController
@RequestMapping
public class LoginController {
    
    @PostMapping("/login")
    public R login(@RequestBody LoginVo vo) {
        if(vo == null) {
            return Result.error("用户名或密码错误");
        }
        if(!"admin".equals(vo.getUsername()) || !"admin@123".equals(vo.getPassword())) {
            return Result.error("用户名或密码错误");
        }
        return Result.ok(UUID.randomUUID().toString());
    }
}
